
import java.util.*;
class Books{
    public String ISBN;
    public String Title;
    public String Authors;
    public String date;
    public int price;

    @Override
    public String toString() {
        return "[Title]"+Title+";[Author]"+Authors+";[PubDate]"+date +
                ";[ISBN]"+ISBN+";[Price]"+price;
    }
}
public class BookSysMain {
    public static int useSize;
    public static List<Books> list = new ArrayList<>();
    public static void main(String[] args) {
        //BookManager bms=new BookManager();
        Scanner in=new Scanner(System.in);
        while(true) {
            //显示菜单
            showMenu();
            System.out.println("Input Command@BMS ~ % ");
            //等待输入命令
            String cmd =in.next();
            in.nextLine();
            //匹配对应命令，执行对应命令
            if(cmd.equals("E")||cmd.equals("e"))
            {System.out.println("[BookSys Info]:Bye Bye!");break;}
            // else if(cmd.equals("L")||cmd.equals("l")) bms.printList();
            // else if(cmd.equals("N")||cmd.equals("n")) bms.addNewBook(in);
            // else if(cmd.equals("Q")||cmd.equals("q")) bms.queryBook(in);
            // else if(cmd.equals("D")||cmd.equals("d")) bms.deleteBook(in);
            // else if(cmd.equals("S")||cmd.equals("s")) bms.saveList();
            else if(cmd.equals("N")||cmd.equals("n")||cmd.equals("1")){
                add();
            }  else if(cmd.equals("Q")||cmd.equals("q")||cmd.equals("3")){
                display();
            } else if(cmd.equals("D")||cmd.equals("d")||cmd.equals("2")){
                //del();
            }
            // else if(cmd.equals("E")||cmd.equals("e")||cmd.equals("6")){

            // }
            else System.out.println("[BookSys Waring]: Invalid Command!");

            //提示回到主菜单
            System.out.println("Type ENTER return to main menu:");
            //in.nextLine();
        }
    }
    public static void showMenu(){
        System.out.println("===================================== ");
        System.out.println("| WelCome to Book Management System |");
        System.out.println("|           (Version 1.0)           |");
        System.out.println("===================================== ");
        System.out.println("| 1 Add New Book (N)                |");
        System.out.println("| 2 Delete Book (D)                 |");
        System.out.println("| 3 Query Books (Q)                 |");
        System.out.println("| 4 List All (L)                    |");
        System.out.println("| 5 Save (S)                        |");
        System.out.println("| 6 Exit (E)                        |");
        System.out.println("===================================== ");
    }
    public static void add(){
        Books book = new Books();
        Scanner in=new Scanner(System.in);
        System.out.println(">>please input ISBN:");
        book.ISBN = in.next();
        System.out.println(">>please input Title:");
        book.Title = in.next();
        System.out.println(">>please input Authors:");
        book.Authors = in.next();
        System.out.println(">>please input Pub Date:");
        book.date = in.next();
        System.out.println(">>please input Price:");
        book.price = in.nextInt();
        list.add(book);
        useSize++;
        System.out.println("[BookSys Info]: The books added:");
//  System.out.println("[Title]"+book.Title+";[Author]"+book.Authors+";[PubDate]"+
//          book.date+";[ISBN]"+book.ISBN+";[Price]"+book.price);
    }
    public static void display(){
        for(Books book:list){
            System.out.println(book.toString());
        }
    }
// public static void del(){
//     System.out.println("Please input the ISBN of the book to delete:");
// //    Books book = new Books();
//     Scanner in=new Scanner(System.in);
//      String str = in.next();
//      for(Books book:list){
//          if(str.equals(book.ISBN)){
//              list.remove(book);
//              System.out.println("[BookSys Info]: The books removed:");
//          }
//      }
//      int index = -1;
//      for(int i = 0;i<useSize;i++){
//          Books book = B
//      }
// //     book.ISBN = str;
// //     list.remove(book.ISBN);

// }

}